package com.gjm.tool.utils;

import cn.hutool.core.collection.CollectionUtil;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

public class TableTest1 {
    public static void main(String[] args) throws Exception{
        List<String> newList = FileUtil.readInfoFromFile("C:\\Users\\Administrator\\Desktop\\table\\25年新建垃圾表.txt");
        List<String> oldList = FileUtil.readInfoFromFile("C:\\Users\\Administrator\\Desktop\\table\\4000垃圾表.txt");

        List<String> newList1 = new ArrayList<>();

        for (String str : newList) {
            List<String> numberList = RegExpValidatorUtils.getNumber(str);
            for (String number : numberList) {
                str = str.replaceAll(number,"");
            }
            newList1.add(str);
        }


        List<String> oldList1 = new ArrayList<>();

        for (String str : oldList) {
            List<String> numberList = RegExpValidatorUtils.getNumber(str);
            for (String number : numberList) {
                str = str.replaceAll(number,"");
            }
            oldList1.add(str);
        }



        Set<String> resultList = oldList1.stream().filter(i -> newList1.contains(i)).collect(Collectors.toSet());
        for (String str : resultList) {
            System.out.println(str);
        }
    }
}
